<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!--    主题样式-->
    <link rel="stylesheet" type="text/css" href="../jeasyui/themes/bootstrap/easyui.css">
    <!-- 配置圖片样式-->
    <link rel="stylesheet" type="text/css" href="../jeasyui/themes/icon.css">
    <!--    引入jquery环境-->
    <script type="text/javascript" src="../jeasyui/jquery.min.js"></script>
    <!--    引入easyui.min.js环境-->
    <script type="text/javascript" src="../jeasyui/jquery.easyui.min.js"></script>
    <!--    引入汉化包-->
    <script type="text/javascript" src="../jeasyui/easyui-lang-zh_CN.js"></script>
    <script>
        $(function (){
            $("#dg").datagrid({
                url: '../user/listPageUsers',
                fit: true,
                fitColumns: true,
                pagination: true,
                pagePosition: 'both',
                toolbar: '#tb',
                columns: [[
                    {field: 'uid', title: '用户ID', width: 100, checkbox: true},
                    {field: 'uname', title: '用户名称', width: 100},
                    {field: 'password', title: '密码', width: 100},
                    {field: 'images', title: '头像', width: 100,
                        formatter:function (val,rows,index){
                        return '<img src="'+val+'" style="height: 60px;width: 60px">'
                        }},
                    {field: 'stats', title: '状态', width: 100,
                    formatter:function (val,rows,index){
                        if (val==0){
                            return "<div style='color:green;font-weight: bold'>启用</div>"
                        }else if (val==1){
                            return "<div style='color:red;font-weight: bold'>禁用</div>"
                        }
                    }},
                    {field: 'createtime', title: '创建时间', width: 100},
                    {field: 'modifytime', title: '修改时间', width: 100},
                ]]
            })
        })

    </script>
</head>
<body>
<div id="dg">

</div>
</body>
</html>